#pragma once

template < class T >
class Point2D
{
private:
    T m_x;
    T m_y;

public:
    Point2D(T x, T y) : m_x(x), m_y(y) {}
    ~Point2D() {}

    // return element position
    friend int FindLexMin(Point2D < T >* const _array, int _len)
    {
        Point2D < T > lexMin = _array[0];
        int index = 0;

        for (int i = 1; i < _len; ++i)
        {
            if ((_array[i].m_x < lexMin.m_x) || ((_array[i].m_x == lexMin.m_x)
                && (_array[i].m_y < lexMin.m_y)))
            {
                lexMin = _array[i];
                index = i;
            }
        }

        return index;
    }
};




template < class T >
void ConvSort(T* const _array, const int _len)
{
    

}